﻿using System;
using System.Globalization;
using System.Windows.Data;

namespace VNet.VisiSuite.Common.Converters
{
    public class IntObjectStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null )
                return "";

            var obj = value as int?;
            if (obj == null)
                return "";

            return obj.Value.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}